package site.assad.service_tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import site.assad.dao.GameDao;
import site.assad.domain.Game;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/12/15 12:31
 * Description:
 */
@Service
public class GameService {

    @Autowired
    private GameDao gameDao ;

    //获取 Game 实例
    public Game getGame(final int gameid,boolean withUserList){
        Game game = null;
        game = gameDao.getGameById(gameid);
        if(withUserList)
            game.setUsers(gameDao.getCollectUserList(game));
        return game;
    }

    //public void addGame(..);  省略

    //public void updateGame(..); 省略

}
